﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AgentController : MonoBehaviour
{
    IInput input;
    /// <summary>
    /// 代理方法对象
    /// </summary>
    AgentMovement movement;

    private void Start()
    {
        input = GetComponent<IInput>();
        movement = GetComponent<AgentMovement>();
        //lambada表达时执行委托
        input.OnMoveMentDirectionInput += movement.HandleMovementDirection;
        input.OnMovementInput += movement.HandleMovement;
    }

    private void OnDisable()
    {
        input.OnMoveMentDirectionInput -= movement.HandleMovementDirection;
        input.OnMovementInput -= movement.HandleMovement;
    }
}
 